<?php

function clearCookies()
{
    setcookie('login', '', time() - 3600);
}


if ($_GET["action"] == "login")
{
    if ($_POST["username"] == 'admin' && $_POST["password"] == 'admin')
    {
        setcookie("login", "true", time() + 3600, '/');
        header("location: ../index.php");
    }
}
elseif ($_GET["action"] == "logout")
{
    setcookie('login', '', time() - 1, '/');
    header("location: ../index.php");
}
